from selenium.webdriver.common.by import By


class PersonalUserLocator:

    pesonal_user_tab = (By.XPATH, "//div[contains(@data-menu-id,'MANAGEMENT_PLT_PERSONAL_USER')]")

    organization_tab = (By.CSS_SELECTOR, '[path="/console/user/personalUser"]')

    # 翻页
    page_total = (By.CSS_SELECTOR, '[class="antd4-pagination-total-text"]')

    #account_phone查询框
    account_phone_query_input=(By.ID,'fuzzy')

    #查询按钮
    account_phone_query_button=(By.XPATH,"//button[contains(@class,'antd4-input-search-button')]")


    #query_result_element
    query_result_element=(By.CSS_SELECTOR,'[class="antd4-table-row antd4-table-row-level-0"]')

    #query_result_elements
    query_result_elements=(By.XPATH,'//tr[contains(@class,"antd4-table-row antd4-table-row-level")]')

    #下载按钮
    download_button=(By.XPATH,'//*[@aria-label="download"]/..')


    #status_filter
    status_filter=(By.XPATH,"(//span[contains(@class,'table-filter-trigger')])[1]/span")

    # 筛选项_normal
    filter_normal = (By.XPATH,'(//span[@class="antd4-checkbox"])[1]')

    # 确认选择项
    filter_ok = (By.XPATH, "//button[contains(@class,'btn-primary antd4-btn')]")

    #状态
    status=(By.XPATH,"//span[contains(@class,'badge-status-text')]")

    # 列表字段
    list_columns = (By.CSS_SELECTOR, "tr th.antd4-table-cell")

    # 加载转菊花
    loading_wait = (By.CSS_SELECTOR, '[class="antd4-spin-dot antd4-spin-dot-spin"]')

    # status字段 和 Dunning status字段
    column_status = (By.CSS_SELECTOR, "tr th.antd4-table-cell span.antd4-table-column-title")

    # status 和 Dunning status 的展开选项按钮
    status_checkbox = (By.CSS_SELECTOR, "tr th.antd4-table-cell span[role='button']")

    # status选项
    status_checkbox_options = (By.CSS_SELECTOR, "span.antd4-dropdown-menu-title-content>span")

    # reset password button
    reset_pwd_button = (By.XPATH, "//tbody//tr[contains(@class, 'antd4-table-row')]/td[9]//button")

    # 用户操作按钮
    user_options_ellipsis = (By.XPATH, "//span[contains(@class,'table-operation-ellipsis')]")

    # 展开的用户操作
    lock_button = (By.XPATH, "(//li[contains(@class,'dropdown-menu-item-only-child')])[1]/span")
    unlock_button = (By.XPATH, "(//li[contains(@class,'dropdown-menu-item-only-child')])[2]/span")
    lock_button_area = (By.XPATH, "(//li[contains(@class,'dropdown-menu-item-only-child')])[1]")
    unlock_button_area = (By.XPATH, "(//li[contains(@class,'dropdown-menu-item-only-child')])[2]")

    # 二次确认窗口的提示语
    reset_prompt_lines = (By.CSS_SELECTOR, "div.main___1Mt3G>div>div")
    lock_prompt_lines = (By.CSS_SELECTOR, "div.main___1Mt3G>div>div>div")

    # 二次确认窗口的accept选框
    accept_ack = (By.XPATH, '//div[@role="dialog"]//input/..')

    # 二次确认窗口的确认按钮
    confirm_button = (By.XPATH, "//div[contains(@class,'modal-footer')]/button[2]")

    # success_pup
    success_pup = (By.XPATH, "//div[@class='antd4-message-notice-content']//span[not(@class)]")

